<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <span class="s"></span>
    <input type="text" id="d1" value="tom">
    <input type="text" id="d2">
    <button onclick="f1()">按钮</button>
    <script>
        function f1(){
            let inputE1 = document.querySelector("#d1");
            console.log("inputE1");
            console.log(inputE1.value);
            let x = inputE1.value;
            console.log(x, typeof x);
            console.log(parseFloat(x));
        }

        let spanE = document.querySelector('.s');
        console.log(spanE);
        spanE.innerHTML = '我是span';

        let inputE1 = document.querySelector('#d1');
        console.log(inputE1);

        let inputE2 = document.getElementById('d2');
        console.log(inputE2);
    </script>
</body>
</html>